﻿@using Orchard.ContentManagement;
@using Orchard.UI.Admin
@using Orchard.Utility.Extensions
@using Orchard.Widgets;
@using Orchard.Widgets.Models

@{
    Style.Require("NyroModal").AtHead();
    Script.Require("NyroModal").AtHead();
    Script.Require("OrchardZoneManagement").AtHead();
}

@if (AuthorizedFor(Permissions.ManageWidgets) && !AdminFilter.IsApplied(WorkContext.HttpContext.Request.RequestContext)) {
    <div class="widget-control">
        <div class="manage-actions" >
            <ul class="manage-zone" data-zonename="@Model.ZoneName">
                <li>
                    <a class="nyroModal" href="@Url.Action("Manage", "Zone", new { area = "NGM.Portlets", zoneName = Model.ZoneName })#content">
                        <img src="@Url.Content("~/modules/NGM.Portlets/Content/icon-tool.png")" alt="@T("Manage the {0} zone", Model.ZoneName)" title="@T("Manage the {0} zone", Model.ZoneName)"/>
                    </a>
                </li>
            </ul>
        </div>
    @Display(Model.Metadata.ChildContent)
    </div>
}
else {
    @Display(Model.Metadata.ChildContent)
}